//using AndroidCaller;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using static UnityEngine.GraphicsBuffer;

public class MenuNavigation : MonoBehaviour
{
	public Settings Settings;

	public GameObject settings_dialog;

	private bool dialog_showing;

	public bool gift_dialog_showing;

	public Dropdown steering_dropdown;

    private MyAdManager adManage;

	private void Start()
	{
		Time.timeScale = 1f;
		AudioListener.pause = false;
        adManage = new MyAdManager();
        //NativeCall.Call("start");
    }

	private void Update()
	{
		if (UnityEngine.Input.GetKeyDown(KeyCode.Escape))
		{
			Exit();
		}
	}

	public void Exit()
	{
		if (dialog_showing)
		{
			HideAllDialogs();
		}
		else if (!gift_dialog_showing)
		{
			//NativeCall.Call("exit");
		}
	}

	public void HideAllDialogs()
	{
		settings_dialog.SetActive(value: false);
		dialog_showing = false;
		SteeringChange(steering_dropdown);

    }

	public void MoreGames()
	{
		//NativeCall.Call("moregames");
	}

	public void Play()
	{
		LoadingPanel.GetInstance().Show();
		SceneManager.LoadScene("Garage");
        adManage.MyShowNative();
    }

	public void SettingsClick()
	{
		dialog_showing = true;
		settings_dialog.SetActive(value: true);
		RefreshSettings();
	}

	public void SteeringChange(Dropdown target)
	{
        Settings.SaveControls(target.value);
	}

	public void RefreshSettings()
	{
		steering_dropdown.value = Settings.GetControls();
	}
}
